<template name="Home">

    <div class="swiper-container swiper-slow f7-ad" style="margin-top:-44px;">
        <div class="swiper-pagination f7-pagination"></div>
        <div class="swiper-wrapper">
            {{#each ad in adList}}
                {{#each img in ad.imgs}}
                    {{#if img.path}}
                    <div class="swiper-slide f7-swiper-slide">
                        {{#if ad.links}}
                        <a href="{{links}}"><img src="{{img.path}}" alt="" width="100%" height="100%"></a>
                        {{else}}
                        <img src="{{img.path}}" alt="" width="100%" height="100%">
                        {{/if}}
                    </div>
                    {{/if}}
                {{/each}}
            {{/each}}
        </div>
    </div> 

    <div id="category">
        {{#if categoryList}}
        <div class="swiper-container swiper-slow f7-category">
            <div class="swiper-pagination"></div>
            <div class="swiper-wrapper">
                {{#each categoryList}}
                <div class="swiper-slide">
                    <div class="f7-swiper-slide">
                        {{#each cat}} {{#if img.path}}
                        <a href="/merchant?cate_id={{id}}">
                            <div class="f7-category-info">
                                <img src="{{img.path}}" alt="">
                                <p>{{name}}</p>
                            </div>
                        </a>
                        {{/if}} {{/each}}
                    </div>
                </div>
                {{/each}}
            </div>
        </div>
        {{/if}} {{#if newsList}}
        <div class="f7-headline">
            <div class="f7-headline-title">37
                <span class="span1">头条</span>
                <span class="span2">
                <i class="f7-icons size-14">volume_fill</i>
            </span>
            </div>
            <div class="f7-headline-content">
                <a href="/news">
                {{#each newsList}}
                <div class="infos">{{title}}</div>
                {{/each}}
            </a>
            </div>
        </div>
        {{/if}} {{#if giftList}}
        <div class="f7-gift">
            <div class="swiper-container swiper-slow" style="height: 100px;">
                <div class="swiper-pagination f7-pagination"></div>
                <div class="swiper-wrapper">
                    {{#each giftList}} {{#if poster_img.path}}
                    <div class="swiper-slide f7-swiper-slide">
                        <a href="/gift/{{id}}">
                        <img src="{{poster_img.path}}" alt="" width="100%" height="100%"></a>
                    </div>
                    {{/if}} {{/each}}
                </div>
            </div>
        </div>
        {{/if}}
        <div class="f7-home-merchant {{visitor}}">
            <div class="f7-home-merchant-title">
                <span class="f7-home-merchant-title-left">——</span>
                <span>附近商家</span>
                <span class="f7-home-merchant-title-right">——</span>
            </div>

            <div class="list-block media-list f7-list-block">
                <ul>
                    {{#each merList}}
                    <li class="s7-list-li">
                        <div class="item-link item-content" style="align-items:flex-start">
                            <a href="/merchantDetail/{{id}}" class="external">
                                <div class="item-media s7-merchant-list-img">
                                    <img src="{{list_image.path}}" class="lazy" width="70px" height="70px">
                                </div>
                            </a>
                            <div class="item-inner s7-item-inner f7-item-inner" style="padding-top:5px !important">
                                <a href="/merchantDetail/{{id}}" class="external">
                                    <div class="item-title">
                                        <div class="s7-item-title-c">
                                            <div class="item-title s7-merchant-title">{{name}}</div>
                                            <div class="item-after s7-merchant-item-after">
                                                <!-- <span class="s7-m">
                                        {{>star stars = stars s_size = 13}}
                                        </span> -->
                                                <span class="s7-m">月销量:{{month_order_count}}</span>
                                                <span class="s7-m-top" style="color:#D84C29 !important">&nbsp;{{labels}}</span>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="item-subtitle"></div>
                                    <div class="item-text" style="height:21px;width:100%">
                                        {{#if cate}}
                                        <span class="s7-cate-label">{{cate}}</span> {{else}}
                                        <span></span> {{/if}}
                                        &nbsp;
                                        <span style="font-size:11px !important">{{site_name}}</span>
                                        <span class="s7-address-label" style="float:right;margin-left:4px">{{jl}}</span>
                                    </div>
                                </a>
                                <a href="/merchantBuy?merchant_id={{id}}" class="external ">
                                    <div class="s7-item-bottom">
                                        <span class="s7-buy-label s7-color-or">买</span>
                                        <span class="s7-buy-detail">
                                      {{#if idle.discount}}
                                      买单{{dis idle.discount}}折&nbsp;&nbsp;{{idle.start}}点到{{idle.end}}点
                                      {{else}}
                                      快速买单
                                      {{/if}}
                                    </span>
                                    </div>
                                </a>
                                {{#each coupons}}
                                <div class="s7-item-extend">
                                    <span class="s7-coupon-label">{{type_cn}}</span>
                                    <span class="s7-buy-detail">{{des}}</span>
                                </div>
                                {{/each}}
                            </div>
                        </div>
                    </li>
                    {{/each}}
                </ul>
            </div>
        </div>
    </div>
    <style>
        .nav-category {
            background: #fff;
        }

        .nav-merchant {
            position: fixed;
        }

    </style>

</template>
